package com.example.ch14springbootlogback.controller;

import com.example.ch14springbootlogback.entity.School;
import com.example.ch14springbootlogback.mapper.SchoolMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author 何杨谊
 * @description: TODO
 * @date 2022/4/4 22:55
 */
@RestController
@RequestMapping("/api/user")
@Slf4j
public class UserController {
    @Autowired
    private SchoolMapper schoolMapper;

    @GetMapping("/{id}")
    public School getList(@PathVariable Integer id) {
        log.info("学校Id:"+id);
        return schoolMapper.selectByPrimaryKey(1);
    }
}
